//
//  UserHelpVc.m
//  YZZX
//
//  Created by Easaa on 15/5/8.
//  Copyright (c) 2015年 Easaa. All rights reserved.
//

#import "UserHelpVc.h"
#import "NSString+XSZCommon.h"

@interface UserHelpVc ()<HXHttpRequestDelegate,UIWebViewDelegate,UIScrollViewDelegate>
{
    HXHttpRequest  *_httpRequest;

}

@end

@implementation UserHelpVc

- (void)viewDidLoad {
    [super viewDidLoad];
   
    
    
    //列表请求
    NSDictionary* dicParams = [NSDictionary dictionaryWithObjectsAndKeys:
                               [XSZ_UICommon useridChangUaerdfLoginBoolString],    @"user_id",
                               @"1",    @"site_id",nil];
    
    
    if (_httpRequest == nil)
    {
        _httpRequest = [[HXHttpRequest alloc] init];
        _httpRequest.delegate = self;
        
        
        
    }
    [_httpRequest requestForParams:dicParams andMethod:YZ_HELP_QUERY andTag:1001];
    
    
    
    
    
    
}

-(void)webMassgeCreat
{
    UIWebView  *MassgeWebView=[[UIWebView alloc] initWithFrame:CGRectMake(0, 0,Dev_ScreenWidth,Dev_ScreenHeight-64)];
    MassgeWebView.delegate=self;
    
    MassgeWebView.scrollView.delegate = self;
    MassgeWebView.scrollView.alwaysBounceVertical = NO;
    MassgeWebView.scrollView.bounces = NO;
    MassgeWebView.scrollView.showsVerticalScrollIndicator = NO;
    
    [MassgeWebView loadHTMLString:self.Content baseURL:[NSURL URLWithString:@"http://www.hellomommy.cn/"]];
    [self.view addSubview:MassgeWebView];
    //     ScrollBackground.contentSize = CGSizeMake(Dev_ScreenWidth, Dev_ScreenHeight-64);
    
   
    
    
}


#pragma mark - HXHttpRequestDelegate  代理

- (void)requestFinished:(NSString *)responseString andStatusCode:(int)statusCode andTag:(NSInteger)tag
{
    
    
    [MBProgressHUD hideHUDForView:self.view animated:YES];
    
    //tableview列表数据
    if(tag == 1001)
    {
        //  NSLog(@"---------------->>>> %@",responseString);
        
        NSDictionary *dic = [[NSDictionary alloc]init];
        dic = [JsonUtil jsonToDic:responseString];
        
        // NSLog(@"---------------->>>> \n%@",dic);
        
         self.Content = dic[@"data"];
        
        [self webMassgeCreat];
//        NSDictionary *dics =[JsonUtil jsonToDic:strs];
//        
//        
//        NSArray *arryy =(NSArray *)dics;
        
        // NSLog(@"---------00------->>>> %@",arryy);
//        
//        NSDictionary *dicuu = [arryy objectAtIndex:0];
//        
//        self.Content                    = [dicuu objectForKey:@"Content"];
//        self.Image                      = [dicuu objectForKey:@"Image"];
//        self.LastChangedTime            = [dicuu objectForKey:@"LastChangedTime"];
//        self.Order                      = [dicuu objectForKey:@"Order"];
//        self.ReleaseDate                = [dicuu objectForKey:@"ReleaseDate"];
//        self.Source                     = [dicuu objectForKey:@"Source"];
//        self.Subtitle                   = [dicuu objectForKey:@"Subtitle"];
//        self.Summary                    = [dicuu objectForKey:@"Summary"];
//        self.Title_massge               = [dicuu objectForKey:@"Title"];
//        self.id_massge                  = [[dicuu objectForKey:@"id"] stringValue];
//        
//        
//        
//        [viewbg removeFromSuperview];
//        [self creatViewAndContorller];
//        self.dicDataComm = dicuu;
        
    }
    
    
}

- (void)requestFailed:(NSError *)error andTag:(NSInteger)tag
{
    
    
    
    
}





@end
